import { createRouter, createWebHistory } from 'vue-router'
import indexLogin from '../views/LoginPage/indexLogin.vue'
import dashboard from '../components/Dashboard/Dashboard.vue'
import teachIndex from '../views/IndexPage/teachIndex.vue'
import teachOpm from '../views/TeachMainPage/teachOpm.vue'
import teachIndexPage from '@/views/TeachMainPage/teachIndexPage.vue'
import examPublish from '@/views/TeachMainPage/examPublish.vue'
import studentIndex from '@/views/IndexPage/studentIndex.vue'
// import TeacherAcademyAnalyse from '../views/TeachMainPage/Academy-analyse.vue'
// import ClassInfo from '../views/TeachMainPage/ClassInfo.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: indexLogin,
    }, {
      path: '/dashboard',
      name: 'dashboard',
      component: dashboard,
    }, {
      path: '/teacher',
      name: 'index',
      component: teachIndex,
      // 子路由
      children: [
        {
          path: '',
          component: teachIndexPage,
        },{
          path: 'advice',
          component: teachOpm,
        },
        {
          path: 'examPublish',
          component: examPublish,
        },
        {
          path: 'connect',
          component: () => import('../views/TeachMainPage/parentConnect.vue')
        },
        {
          path: 'ClassInfo',
          component: () => import('../views/TeachMainPage/ClassInfo.vue'),
        },{
          path: 'Academyanalyse',
          component: () => import('../views/TeachMainPage/Academy-analyse.vue'),
        }
      ]
    }, {
      path: '/student',
      name: 'student',
      component: studentIndex,
      children: [
        {
          path: '',
          component: () => import('../views/StudentMainPage/studentIndexPage.vue'),
        },
        {
          path: 'ExamList',
          component: () => import('../views/StudentMainPage/ExamList.vue')
        },
        {
          path: 'studentExam',
          component: () => import('../views/StudentMainPage/studentExam.vue')
        },{
          path: 'Academyanalyse',
          component:()=>import('../views/StudentMainPage/Academy-analyse.vue'),
        },{
          path: 'exam',
          component:()=>import('../views/StudentMainPage/studentExam.vue'),
        },{
          path: 'errorQue',
          component:()=>import('../views/StudentMainPage/errorQuestion.vue'),
        }
      ]
    },
  // {
    //   path: '/StudentAcademyanalyse',
    //   name: 'StudentAcademyanalyse',
    //   component: () => import('../views/StudentMainPage/StudentAcademyAnalyse.vue'),
    // }, {
    //   path: '/TeacherAcademyanalyse',
    //   name: 'TeacherAcademyanalyse',
    //   component: () => import('../views/TeachMainPage/TeacherAcademyAnalyse.vue'),
    // }, {
    //   path: '/studentExam',
    //   name: 'ExamList',
    //   component: () => import('../views/StudentMainPage/studentExam.vue')
    // }
  ],
})

export default router
